package com.imooc.order.utils;

import java.util.Random;

/**
 * Description: 主键工具类
 * Project: order <br />
 * ClassName: KeyUtil <br />
 * Copyright: Copyright (c) 2018 deshang<br />
 *
 * @author Wang Shaopeng
 * @date 2018/12/8 21:26
 * @modifier
 * @modifyContent
 */
public class KeyUtil {

    /**
     * 生成唯一的主键
     * @author Wang Shaopeng
     * @date 2018/12/8 21:28
     * @Param []
     * @return java.lang.String
     */
    public static synchronized String genUniqueKey() {
        Random random = new Random();
        Integer number = random.nextInt(900000) + 100000;
        return System.currentTimeMillis() + number.toString();
    }
}
